{
LANG : PASCAL
PROB : br2
}

program BR2;
const
  fi = 'br2.in';
  fo = 'br2.out';
  d : array[1..121] of longint =
  (6, 28, 220, 284, 496, 1184, 1210, 2620, 2924, 5020, 5564, 6232, 6368, 8128,
  10744, 10856, 12285, 14595, 12496, 14288, 15472, 14536, 14264, 14316, 19116,
  31704, 47616, 83328, 177792, 295488, 629072, 589786, 294896, 358336, 418904,
  366556, 274924, 275444, 243760, 376736, 381028, 285778, 152990, 122410,
  97946, 48976, 45946, 22976, 22744, 19916, 17716, 17296, 18416, 63020, 76084,
  66928, 66992, 67095, 71145, 69615, 87633, 79750, 88730, 100485, 124155,
  122265, 139815, 122368, 123152, 141664, 153176, 142310, 168730, 171856,
  176336, 176272, 180848, 185368, 203432, 196724, 202444, 280540, 365084,
  308620, 389924, 319550, 430402, 356408, 399592, 437456, 455344, 469028,
  486178, 503056, 514736, 522405, 525915, 600392, 669688, 609928, 686072,
  624184, 691256, 635624, 712216, 643336, 652664, 667964, 783556, 726104,
  796696, 802725, 863835, 879712, 901424, 898216, 980984, 947835, 1125765,
  998104, 1043096);
  p : array[1..49] of integer =
  (0, 1, 2, 4, 5, 7, 9, 11, 13, 14, 16, 18, 23, 51, 53, 55, 57, 59, 61, 63,
  65, 67, 69, 71, 73, 75, 77, 79, 81, 83, 85, 87, 89, 91, 93, 95, 97, 99,
  101, 103, 105, 107, 109, 111, 113, 115, 117, 119, 121);
var
  a, b : longint;

procedure process;
var
  i, j : longint;
begin
  for i := 1 to 48 do
    if (a <= d[p[i]+1]) and (d[p[i]+1] <= b) then
    begin
      for j := p[i]+1 to p[i+1]-1 do write(d[j], ' ');
      write(d[p[i+1]]);
      writeln;
    end;
end;

begin
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);
  read(a, b);
  process;
  close(output);
  close(input);
end.
